home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / TommyVideo.iso / flash / volumes / volume_5.swf / scripts / %3Cdefault package%3E / FDraggablePaneSymbol.as next >
Encoding:
Text File  |  2003-06-08  |  23.2 KB  |  742 lines

  1. FDraggablePaneClass = function()
  2. {
  3.    this.init();
  4. };
  5. FDraggablePaneClass.prototype = new FUIComponentClass();
  6. Object.registerClass("FDraggablePaneSymbol",FDraggablePaneClass);
  7. FDraggablePaneClass.prototype.kDefaultTitlebarHeight = 20;
  8. FDraggablePaneClass.prototype.init = function()
  9. {
  10.    super.setSize(this._width,this._height);
  11.    this.controller = this;
  12.    this.level = 1;
  13.    this.attachMovie("TitleArea","titleArea_mc",this.level++,{controller:this});
  14.    this.attachMovie("Separator","separator_mc",this.level++,{controller:this});
  15.    this.attachMovie("FLabelSymbol","titleText_mc",this.level++,{controller:this});
  16.    this.attachMovie("FScrollPaneSymbol","scrollpane_mc",this.level++,{controller:this});
  17.    this.attachMovie("CloseBox","closeBox_mc",this.level++,{controller:this});
  18.    this.attachMovie("Shader","shader_mc",this.level++,{controller:this});
  19.    this.attachMovie("ResizeGrip","resizeGrip_mc",this.level++,{controller:this});
  20.    this.attachMovie("ResizeCursor","resizeCursor_mc",this.level++,{controller:this});
  21.    if(this.boundingBox_mc == undefined)
  22.    {
  23.       this.attachMovie("FBoundingBoxSymbol","boundingBox_mc",this.level++);
  24.    }
  25.    super.init();
  26.    this.boundingBox_mc.controller = this;
  27.    this.boundingBox_mc._visible = false;
  28.    this.normalWidth = this.width;
  29.    this.normalHeight = this.height;
  30.    this.normalX = this._x;
  31.    this.normalY = this._y;
  32.    this.maxWidth = -1;
  33.    this.maxHeight = -1;
  34.    this.minWidth = -1;
  35.    this.minHeight = -1;
  36.    this.closeHandler = this.defaultCloseHandler;
  37.    this.activateHandler = this.defaultActivateHandler;
  38.    this.titleText_mc.labelField.autoSize = "left";
  39.    if(this.hasShader == undefined)
  40.    {
  41.       this.hasShader = true;
  42.    }
  43.    if(this.hasCloseBox == undefined)
  44.    {
  45.       this.hasCloseBox = true;
  46.    }
  47.    if(this.resizable == undefined)
  48.    {
  49.       this.resizable = true;
  50.    }
  51.    if(this.isScrolling == undefined)
  52.    {
  53.       this.isScrolling = true;
  54.    }
  55.    this.enableShader();
  56.    this.shader_mc.isMultistate = true;
  57.    this.shader_mc.inAlternateState = false;
  58.    this.shaderDisabled = false;
  59.    this.setHasShader(this.hasShader);
  60.    this.isShaded = false;
  61.    this.enableCloseBox();
  62.    this.closeBox_mc.isMultistate = false;
  63.    this.closeBox_mc.inAlternateState = false;
  64.    this.setHasCloseBox(this.hasCloseBox);
  65.    this.resizeGrip_mc.onPress = this.resizeTrackBegin;
  66.    this.resizeGrip_mc.onRelease = this.resizeTrackEnd;
  67.    this.resizeGrip_mc.onReleaseOutside = this.resizeTrackEnd;
  68.    this.resizeCursor_mc._visible = false;
  69.    this.resizeGrip_mc.onRollOver = this.setResizeCursor;
  70.    this.resizeGrip_mc.onRollOut = this.restoreCursor;
  71.    this.setTitlebarHeightHelper(this.titlebarHeight);
  72.    this.setResizable(this.resizable);
  73.    this.titleArea_mc.onPress = this.titleTrackBegin;
  74.    this.titleArea_mc.onRelease = this.titleTrackEnd;
  75.    this.titleArea_mc.onReleaseOutside = this.titleTrackEnd;
  76.    this.titleText_mc.onPress = this.titleTrackBegin;
  77.    this.titleText_mc.onRelease = this.titleTrackEnd;
  78.    this.titleText_mc.onReleaseOutside = this.titleTrackEnd;
  79.    this.scrollpane_mc.setDragContent(false);
  80.    this.scrollpane_mc.refreshPane();
  81.    if(this.scrollContent != "")
  82.    {
  83.       this.setScrollContent(this.scrollContent);
  84.    }
  85.    this.setScrolling(this.isScrolling);
  86.    this.setPaneTitle(this.paneTitle);
  87.    this.setSize(this.width,this.height);
  88.    if(FDraggablePaneClass.prototype.doubleclickDuration == undefined)
  89.    {
  90.       FDraggablePaneClass.prototype.doubleclickDuration = 300;
  91.    }
  92.    this.lastTitleBarClick = 0;
  93.    this.titleArea_mc.onMouseDown = this.doubleClickMouseDownChecker;
  94.    this.titleArea_mc.onEnterFrame = this.doubleClickEnterFrameChecker;
  95.    this.boundingBox_mc.onMouseDown = this.boundingClickCheck;
  96.    if(FDraggablePaneClass.prototype.paneList == undefined)
  97.    {
  98.       FDraggablePaneClass.prototype.paneList = new Array();
  99.    }
  100.    this.onUnload = this.handleClose;
  101.    FDraggablePaneClass.prototype.paneList.push(this);
  102.    FDraggablePaneClass.prototype.checkedPaneCount = 0;
  103.    FDraggablePaneClass.prototype.topMostClickedDepth = -32768;
  104. };
  105. FDraggablePaneClass.prototype.setEnabled = function(enabledFlag)
  106. {
  107.    var enabled = arguments.length <= 0 ? true : enabledFlag;
  108.    this.separator_mc.enabled = enabled;
  109.    this.titleArea_mc.enabled = enabled;
  110.    this.icon_mc.enabled = enabled;
  111.    this.titleText_mc.setEnabled(enabled);
  112.    this.titleText_mc.enabled = enabled;
  113.    this.shader_mc.enabled = enabled;
  114.    this.closeBox_mc.enabled = enabled;
  115.    this.scrollpane_mc.enabled = enabled;
  116.    this.resizeGrip_mc.enabled = enabled;
  117.    this.boundingBox_mc.enabled = enabled;
  118.    super.setEnabled(enabledFlag);
  119. };
  120. FDraggablePaneClass.prototype.setActivateHandler = function(newHandler)
  121. {
  122.    this.activateHandler = newHandler;
  123. };
  124. FDraggablePaneClass.prototype.getScrollContent = function()
  125. {
  126.    return this.scrollpane_mc.getScrollContent();
  127. };
  128. FDraggablePaneClass.prototype.setScrollContent = function(target)
  129. {
  130.    this.scrollpane_mc.setScrollContent(target);
  131. };
  132. FDraggablePaneClass.prototype.setDragContent = function(dragFlag)
  133. {
  134.    this.scrollpane_mc.setDragContent(dragFlag);
  135. };
  136. FDraggablePaneClass.prototype.getScrollPosition = function()
  137. {
  138.    return this.scrollpane_mc.getScrollPosition();
  139. };
  140. FDraggablePaneClass.prototype.setScrollPosition = function(x, y)
  141. {
  142.    this.scrollpane_mc.setScrollPosition(x,y);
  143. };
  144. FDraggablePaneClass.prototype.setTitlebarHeight = function(titlebarHeight)
  145. {
  146.    this.setTitlebarHeightHelper(titlebarHeight);
  147.    this.formatFrame(this._x,this._y,this.width,this.height);
  148. };
  149. FDraggablePaneClass.prototype.setTitlebarHeightHelper = function(newHeight)
  150. {
  151.    if(newHeight == undefined || isNaN(newHeight) || newHeight <= 0)
  152.    {
  153.       this.titlebarHeight = FDraggablePaneClass.prototype.kDefaultTitlebarHeight;
  154.    }
  155.    else
  156.    {
  157.       this.titlebarHeight = newHeight;
  158.    }
  159. };
  160. FDraggablePaneClass.prototype.getTitlebarHeight = function()
  161. {
  162.    return this.titlebarHeight;
  163. };
  164. FDraggablePaneClass.prototype.setScrolling = function(prop)
  165. {
  166.    this.scrollpane_mc.setHScroll(prop);
  167.    this.scrollpane_mc.setVScroll(prop);
  168.    this.isScrolling = prop;
  169. };
  170. FDraggablePaneClass.prototype.getScrolling = function()
  171. {
  172.    return this.isScrolling;
  173. };
  174. FDraggablePaneClass.prototype.loadScrollContent = function(urlString, handler, location)
  175. {
  176.    this.scrollpane_mc.loadScrollContent(urlString,handler,location);
  177. };
  178. FDraggablePaneClass.prototype.refreshScrollContent = function()
  179. {
  180.    this.scrollpane_mc.refreshPane();
  181. };
  182. FDraggablePaneClass.prototype.getPaneMaximums = function()
  183. {
  184.    var xMax = this.maxWidth;
  185.    var yMax = this.maxHeight;
  186.    return {x:xMax,y:yMax};
  187. };
  188. FDraggablePaneClass.prototype.getPaneMinimums = function()
  189. {
  190.    var xMin = this.minWidth;
  191.    var yMin = this.minHeight;
  192.    return {x:xMin,y:yMin};
  193. };
  194. FDraggablePaneClass.prototype.setPaneMaximumSize = function(w, h)
  195. {
  196.    this.maxWidth = w;
  197.    this.maxHeight = h;
  198. };
  199. FDraggablePaneClass.prototype.setPaneMinimumSize = function(w, h)
  200. {
  201.    this.minWidth = w;
  202.    this.minHeight = h;
  203. };
  204. FDraggablePaneClass.prototype.setHasCloseBox = function(closeBox)
  205. {
  206.    this.hasCloseBox = closeBox;
  207.    this.closeBox_mc._visible = closeBox;
  208. };
  209. FDraggablePaneClass.prototype.getHasCloseBox = function()
  210. {
  211.    return this.hasCloseBox;
  212. };
  213. FDraggablePaneClass.prototype.setHasShader = function(shader)
  214. {
  215.    this.hasShader = shader;
  216.    this.shader_mc._visible = shader;
  217. };
  218. FDraggablePaneClass.prototype.getHasShader = function()
  219. {
  220.    return this.hasShader;
  221. };
  222. FDraggablePaneClass.prototype.enableShader = function()
  223. {
  224.    this.shader_mc.onPress = this.widgetTrackBegin;
  225.    this.shader_mc.onRelease = this.widgetTrackEndWithAction;
  226.    this.shader_mc.onReleaseOutside = this.widgetTrackEnd;
  227.    this.shader_mc.onDragOut = this.widgetTrackOut;
  228.    this.shader_mc.onDragOver = this.widgetTrackOver;
  229.    this.shader_mc.actionHandler = this.shaderAction;
  230.    if(this.shader_mc.inAlternateState)
  231.    {
  232.       this.shader_mc.gotoAndStop(4);
  233.    }
  234.    else
  235.    {
  236.       this.shader_mc.gotoAndStop(1);
  237.    }
  238.    this.shaderDisabled = false;
  239. };
  240. FDraggablePaneClass.prototype.disableShader = function()
  241. {
  242.    this.shader_mc.onPress = null;
  243.    this.shader_mc.onRelease = null;
  244.    this.shader_mc.onReleaseOutside = null;
  245.    this.shader_mc.onDragOut = null;
  246.    this.shader_mc.onDragOver = null;
  247.    this.shader_mc.actionHandler = null;
  248.    this.shader_mc.gotoAndStop(2);
  249.    this.shaderDisabled = true;
  250. };
  251. FDraggablePaneClass.prototype.enableCloseBox = function()
  252. {
  253.    this.closeBox_mc.onPress = this.widgetTrackBegin;
  254.    this.closeBox_mc.onRelease = this.widgetTrackEndWithAction;
  255.    this.closeBox_mc.onReleaseOutside = this.widgetTrackEnd;
  256.    this.closeBox_mc.onDragOut = this.widgetTrackOut;
  257.    this.closeBox_mc.onDragOver = this.widgetTrackOver;
  258.    this.closeBox_mc.actionHandler = this.closeAction;
  259.    this.closeBox_mc.gotoAndStop(1);
  260. };
  261. FDraggablePaneClass.prototype.disableCloseBox = function()
  262. {
  263.    this.closeBox_mc.onPress = null;
  264.    this.closeBox_mc.onRelease = null;
  265.    this.closeBox_mc.onReleaseOutside = null;
  266.    this.closeBox_mc.onDragOut = null;
  267.    this.closeBox_mc.onDragOver = null;
  268.    this.closeBox_mc.actionHandler = null;
  269.    this.closeBox_mc.gotoAndStop(2);
  270. };
  271. FDraggablePaneClass.prototype.setResizable = function(resizable)
  272. {
  273.    this.resizable = resizable;
  274.    this.resizeGrip_mc._visible = resizable;
  275. };
  276. FDraggablePaneClass.prototype.getResizable = function()
  277. {
  278.    return this.resizable;
  279. };
  280. FDraggablePaneClass.prototype.setSize = function(w, h)
  281. {
  282.    if(arguments.length < 2 || isNaN(w) || isNaN(h))
  283.    {
  284.       return undefined;
  285.    }
  286.    w = Math.max(w,60);
  287.    if(this.isShaded)
  288.    {
  289.       h = Math.max(h,this.defaultShadedHeight());
  290.    }
  291.    else
  292.    {
  293.       h = Math.max(h,60 + this.defaultShadedHeight() + 1);
  294.    }
  295.    this._xscale = 100;
  296.    this._yscale = 100;
  297.    super.setSize(w,h);
  298.    this.boundingBox_mc._width = w;
  299.    this.boundingBox_mc._height = h;
  300.    this.formatFrame(this._x,this._y,w,h);
  301. };
  302. FDraggablePaneClass.prototype.setContentSize = function(w, h)
  303. {
  304.    var newWidth = w;
  305.    if(this.controller.isScrolling)
  306.    {
  307.       newWidth += this.controller.scrollpane_mc.vScrollBar_mc._width;
  308.    }
  309.    var newHeight = h + 1 + this.controller.getTitlebarHeight();
  310.    if(this.controller.isScrolling)
  311.    {
  312.       newHeight += this.controller.scrollpane_mc.hScrollBar_mc._height;
  313.    }
  314.    this.setPaneSize(newWidth,newHeight);
  315. };
  316. FDraggablePaneClass.prototype.setPaneSize = function(w, h)
  317. {
  318.    var newWidth = w;
  319.    var newHeight = h;
  320.    if(newWidth == undefined)
  321.    {
  322.       newWidth = 320;
  323.    }
  324.    if(newHeight == undefined)
  325.    {
  326.       newHeight = 240;
  327.    }
  328.    if(this.maxWidth > 0 && newWidth > this.maxWidth)
  329.    {
  330.       newWidth = this.maxWidth;
  331.    }
  332.    if(this.minWidth > 0 && newWidth < this.minWidth)
  333.    {
  334.       newWidth = this.minWidth;
  335.    }
  336.    if(newWidth < this.defaultMinimumWidth())
  337.    {
  338.       newWidth = this.defaultMinimumWidth();
  339.    }
  340.    if(this.maxHeight > 0 && newHeight > this.maxHeight)
  341.    {
  342.       newHeight = this.maxHeight;
  343.    }
  344.    if(this.minHeight > 0 && newHeight < this.minHeight)
  345.    {
  346.       newHeight = this.minHeight;
  347.    }
  348.    if(newHeight < this.defaultShadedHeight() + this.resizeGrip_mc._height)
  349.    {
  350.       newHeight = this.defaultShadedHeight() + this.resizeGrip_mc._height;
  351.    }
  352.    if(this.isShaded)
  353.    {
  354.       this.normalWidth = newWidth;
  355.       this.normalHeight = newHeight;
  356.       newHeight = this.defaultShadedHeight();
  357.    }
  358.    this.setSize(newWidth,newHeight);
  359. };
  360. FDraggablePaneClass.prototype.closePane = function()
  361. {
  362.    if(this.closeHandler())
  363.    {
  364.       this.unloadMovie();
  365.    }
  366. };
  367. FDraggablePaneClass.prototype.setCloseHandler = function(newHandler)
  368. {
  369.    this.closeHandler = newHandler;
  370. };
  371. FDraggablePaneClass.prototype.shadePane = function()
  372. {
  373.    this.preserveNormals();
  374.    this.isShaded = true;
  375.    this.setSize(this.width,this.defaultShadedHeight());
  376.    this.resizeGrip_mc._visible = false;
  377.    this.scrollpane_mc._visible = false;
  378.    this.separator_mc._visible = false;
  379.    this.shader_mc.inAlternateState = true;
  380.    this.shader_mc.gotoAndStop(4);
  381. };
  382. FDraggablePaneClass.prototype.restorePane = function()
  383. {
  384.    if(this.isShaded == false)
  385.    {
  386.       return undefined;
  387.    }
  388.    this._x = this.normalX;
  389.    this._y = this.normalY;
  390.    this.setSize(this.normalWidth,this.normalHeight);
  391.    if(this.resizable)
  392.    {
  393.       this.controller.resizeGrip_mc._visible = true;
  394.    }
  395.    this.scrollpane_mc._visible = true;
  396.    this.separator_mc._visible = true;
  397.    this.isShaded = false;
  398.    this.swapFromShaded();
  399. };
  400. FDraggablePaneClass.prototype.getPaneTitle = function()
  401. {
  402.    return this.titleText_mc.labelField.text;
  403. };
  404. FDraggablePaneClass.prototype.setPaneTitle = function(title)
  405. {
  406.    this.titleText_mc.setLabel(title);
  407.    this.formatTitle(this.closeBox_mc._x);
  408. };
  409. FDraggablePaneClass.prototype.setStyleProperty = function(propName, value, isGlobal)
  410. {
  411.    super.setStyleProperty(propName,value,isGlobal);
  412.    this.scrollpane_mc.setStyleProperty(propName,value,isGlobal);
  413. };
  414. FDraggablePaneClass.prototype.formatTitle = function(closeBoxOffset)
  415. {
  416.    var txtS = this.textStyle;
  417.    var sTbl = this.styleTable;
  418.    txtS.align = sTbl.textAlign.value != undefined ? undefined : (txtS.align = "left");
  419.    txtS.leftMargin = sTbl.textLeftMargin.value != undefined ? undefined : (txtS.leftMargin = 0);
  420.    txtS.rightMargin = sTbl.textRightMargin.value != undefined ? undefined : (txtS.rightMargin = 0);
  421.    txtS.leading = 0;
  422.    this.titleText_mc.labelField.setTextFormat(txtS);
  423.    var textWidth = this.titleText_mc.labelField.textWidth;
  424.    var textHeight = this.titleText_mc.labelField.textHeight;
  425.    this.titleText_mc._y = this.titleArea_mc._y + (this.titleArea_mc._height - textHeight) / 2 - 2;
  426.    if(this.textStyle.align == "center")
  427.    {
  428.       this.titleText_mc._x = this.titleArea_mc._x + (this.titleArea_mc._width - textWidth) / 2;
  429.    }
  430.    else if(this.textStyle.align == "left")
  431.    {
  432.       this.titleText_mc._x = this.titleArea_mc._x + this.shader_mc._x + this.shader_mc._width;
  433.    }
  434.    else if(this.textStyle.align == "right")
  435.    {
  436.       this.titleText_mc._x = closeBoxOffset - this.titleText_mc._width;
  437.    }
  438.    if(this.titleText_mc._x + this.titleText_mc._width > closeBoxOffset)
  439.    {
  440.       this.titleText_mc._x = closeBoxOffset - this.titleText_mc._width;
  441.    }
  442. };
  443. FDraggablePaneClass.prototype.formatFrame = function(x, y, w, h)
  444. {
  445.    var titleHeight = this.getTitlebarHeight();
  446.    var widgetSpacer = 2;
  447.    var thisWidth = w;
  448.    var thisHeight = h;
  449.    this.separator_mc._x = 0;
  450.    this.separator_mc._y = titleHeight;
  451.    this.separator_mc._width = thisWidth;
  452.    this.separator_mc._height = 1;
  453.    this.titleArea_mc._x = 0;
  454.    this.titleArea_mc._y = 0;
  455.    this.titleArea_mc._width = thisWidth;
  456.    this.titleArea_mc._height = titleHeight;
  457.    this.scrollpane_mc._x = 0;
  458.    this.scrollpane_mc._y = titleHeight + 1;
  459.    this.scrollpane_mc.setSize(thisWidth,thisHeight - (titleHeight + 1));
  460.    this.shader_mc._x = widgetSpacer;
  461.    this.shader_mc._y = this.titleArea_mc._y + (this.titleArea_mc._height - this.shader_mc._height) / 2;
  462.    this.closeBox_mc._x = thisWidth - (this.closeBox_mc._width + widgetSpacer);
  463.    this.closeBox_mc._y = this.titleArea_mc._y + (this.titleArea_mc._height - this.closeBox_mc._height) / 2;
  464.    this.resizeGrip_mc._x = thisWidth - this.resizeGrip_mc._width;
  465.    this.resizeGrip_mc._y = thisHeight - this.resizeGrip_mc._height;
  466.    this.formatTitle(this.closeBox_mc._x);
  467.    this.setEnabled(this.enable);
  468. };
  469. FDraggablePaneClass.prototype.defaultCloseHandler = function()
  470. {
  471.    return true;
  472. };
  473. FDraggablePaneClass.prototype.defaultActivateHandler = function()
  474. {
  475.    i = 0;
  476.    while(i < FDraggablePaneClass.prototype.paneList.length - 1)
  477.    {
  478.       if(FDraggablePaneClass.prototype.paneList[i] == this.controller)
  479.       {
  480.          var clickedPane = FDraggablePaneClass.prototype.paneList[i];
  481.          var eclipsedPane = FDraggablePaneClass.prototype.paneList[i + 1];
  482.          clickedPane.swapDepths(eclipsedPane);
  483.          FDraggablePaneClass.prototype.paneList[i] = eclipsedPane;
  484.          FDraggablePaneClass.prototype.paneList[i + 1] = clickedPane;
  485.       }
  486.       i++;
  487.    }
  488. };
  489. FDraggablePaneClass.prototype.defaultMinimumWidth = function()
  490. {
  491.    var widgetSpacer = 2;
  492.    var minimalWidth = 2 * widgetSpacer;
  493.    minimalWidth += this.shader_mc._width + this.closeBox_mc._width;
  494.    minimalWidth += Math.max(this.titleText_mc._width,60);
  495.    return minimalWidth;
  496. };
  497. FDraggablePaneClass.prototype.defaultMinimumHeight = function()
  498. {
  499.    var minimalHeigth = this.controller.getTitlebarHeight() + 1;
  500.    minimalHeigth += 60;
  501.    return minimalHeigth;
  502. };
  503. FDraggablePaneClass.prototype.defaultShadedHeight = function()
  504. {
  505.    var shadedHeight = this.controller.getTitlebarHeight();
  506.    return shadedHeight;
  507. };
  508. FDraggablePaneClass.prototype.doubleClickMouseDownChecker = function()
  509. {
  510.    if(this.hitTest(_root._xmouse,_root._ymouse,true))
  511.    {
  512.       if(this.controller.lastTitleBarClick == 0)
  513.       {
  514.          this.controller.lastTitleBarClick = getTimer();
  515.       }
  516.       else
  517.       {
  518.          this.controller.lastTitleBarClick = 0;
  519.          if(this.controller.getHasShader() && this.controller.shaderDisabled == false && this.controller.isShaded == false && this.controller.isTopmostPane() && this.controller.enable)
  520.          {
  521.             this.controller.shadePane();
  522.          }
  523.          else if(this.controller.isShaded && this.controller.isTopmostPane())
  524.          {
  525.             this.controller.restorePane();
  526.          }
  527.       }
  528.    }
  529. };
  530. FDraggablePaneClass.prototype.doubleClickEnterFrameChecker = function()
  531. {
  532.    if(this.controller.lastTitleBarClick > 0)
  533.    {
  534.       if(getTimer() - this.controller.lastTitleBarClick > FDraggablePaneClass.prototype.doubleclickDuration)
  535.       {
  536.          this.controller.lastTitleBarClick = 0;
  537.       }
  538.    }
  539. };
  540. FDraggablePaneClass.prototype.setResizeCursor = function()
  541. {
  542.    this.controller.resizeCursor_mc._x = this.controller._xmouse;
  543.    this.controller.resizeCursor_mc._y = this.controller._ymouse;
  544.    this.controller.resizeCursor_mc._visible = true;
  545.    this.onMouseMove = this.controller.dragResizeCursor;
  546.    Mouse.hide();
  547. };
  548. FDraggablePaneClass.prototype.restoreCursor = function()
  549. {
  550.    this.controller.resizeCursor_mc._visible = false;
  551.    this.onMouseMove = null;
  552.    Mouse.show();
  553. };
  554. FDraggablePaneClass.prototype.dragResizeCursor = function()
  555. {
  556.    this.controller.resizeCursor_mc._visible = true;
  557.    this.controller.resizeCursor_mc._x = this.controller._xmouse;
  558.    this.controller.resizeCursor_mc._y = this.controller._ymouse;
  559. };
  560. FDraggablePaneClass.prototype.minimizeHelper = function()
  561. {
  562.    if(this.controller.minimizeExtensionHandler != null)
  563.    {
  564.       this.controller.minimizeExtensionHandler(this.controller);
  565.    }
  566. };
  567. FDraggablePaneClass.prototype.activateHelper = function()
  568. {
  569.    if(this.controller.activateHandler != null)
  570.    {
  571.       this.controller.activateHandler(this.controller);
  572.    }
  573. };
  574. FDraggablePaneClass.prototype.boundingClickCheck = function()
  575. {
  576.    FDraggablePaneClass.prototype.checkedPaneCount = FDraggablePaneClass.prototype.checkedPaneCount + 1;
  577.    if(this.controller.boundingBox_mc.hitTest(_root._xmouse,_root._ymouse,false))
  578.    {
  579.       if(this.controller.getDepth() > FDraggablePaneClass.prototype.topMostClickedDepth || FDraggablePaneClass.prototype.topMostClickedDepth == -32768)
  580.       {
  581.          FDraggablePaneClass.prototype.topMostClickedDepth = this.controller.getDepth();
  582.          FDraggablePaneClass.prototype.topMostClickedPane = this.controller;
  583.       }
  584.    }
  585.    if(FDraggablePaneClass.prototype.checkedPaneCount == FDraggablePaneClass.prototype.paneList.length)
  586.    {
  587.       FDraggablePaneClass.prototype.topMostClickedPane.activateHelper();
  588.       FDraggablePaneClass.prototype.topMostClickedDepth = -32768;
  589.       FDraggablePaneClass.prototype.checkedPaneCount = 0;
  590.    }
  591. };
  592. FDraggablePaneClass.prototype.isTopmostPane = function()
  593. {
  594.    return this == FDraggablePaneClass.prototype.paneList[FDraggablePaneClass.prototype.paneList.length - 1];
  595. };
  596. FDraggablePaneClass.prototype.handleClose = function()
  597. {
  598.    i = 0;
  599.    while(i < FDraggablePaneClass.prototype.paneList.length)
  600.    {
  601.       if(FDraggablePaneClass.prototype.paneList[i] == this.controller)
  602.       {
  603.          FDraggablePaneClass.prototype.paneList.splice(i,1);
  604.       }
  605.       i++;
  606.    }
  607. };
  608. FDraggablePaneClass.prototype.swapFromShaded = function()
  609. {
  610.    this.shader_mc.inAlternateState = false;
  611.    if(this.shaderDisabled)
  612.    {
  613.       this.shader_mc.gotoAndStop(2);
  614.    }
  615.    else
  616.    {
  617.       this.shader_mc.gotoAndStop(1);
  618.    }
  619. };
  620. FDraggablePaneClass.prototype.preserveNormals = function()
  621. {
  622.    if(this.isShaded == false)
  623.    {
  624.       this.normalWidth = this.width;
  625.       this.normalHeight = this.height;
  626.    }
  627.    this.normalX = this._x;
  628.    this.normalY = this._y;
  629. };
  630. FDraggablePaneClass.prototype.titleTrackBegin = function(x, y)
  631. {
  632.    if(this.controller.isTopmostPane())
  633.    {
  634.       this.controller.startDrag();
  635.    }
  636. };
  637. FDraggablePaneClass.prototype.titleTrackEnd = function(x, y)
  638. {
  639.    this.controller.stopDrag();
  640.    this.controller.preserveNormals();
  641. };
  642. FDraggablePaneClass.prototype.resizeTrackBegin = function()
  643. {
  644.    Mouse.hide();
  645.    this.controller.resizeCursor_mc._visible = true;
  646.    this.anchorX = this._xmouse;
  647.    this.anchorY = this._ymouse;
  648.    this.onMouseMove = function()
  649.    {
  650.       this.controller.dragResizeCursor();
  651.       var newWidth = this.controller.width + (this._xmouse - this.anchorX);
  652.       var newHeight = this.controller.height + (this._ymouse - this.anchorY);
  653.       if(newHeight < this.controller.defaultMinimumHeight())
  654.       {
  655.          newHeight = this.controller.defaultMinimumHeight();
  656.       }
  657.       this.controller.setPaneSize(newWidth,newHeight);
  658.    };
  659. };
  660. FDraggablePaneClass.prototype.resizeTrackEnd = function()
  661. {
  662.    this.controller.restoreCursor();
  663.    this.onMouseMove = null;
  664. };
  665. FDraggablePaneClass.prototype.widgetTrackBegin = function()
  666. {
  667.    if(this.isMultistate && this.inAlternateState)
  668.    {
  669.       this.gotoAndStop(5);
  670.    }
  671.    else
  672.    {
  673.       this.gotoAndStop(3);
  674.    }
  675. };
  676. FDraggablePaneClass.prototype.widgetTrackEnd = function()
  677. {
  678.    if(this.isMultistate && this.inAlternateState)
  679.    {
  680.       this.gotoAndStop(4);
  681.    }
  682.    else
  683.    {
  684.       this.gotoAndStop(1);
  685.    }
  686. };
  687. FDraggablePaneClass.prototype.widgetTrackEndWithAction = function()
  688. {
  689.    this.actionHandler();
  690.    if(this.isMultistate && this.inAlternateState)
  691.    {
  692.       this.gotoAndStop(4);
  693.    }
  694.    else
  695.    {
  696.       this.gotoAndStop(1);
  697.    }
  698. };
  699. FDraggablePaneClass.prototype.widgetTrackOut = function()
  700. {
  701.    if(this.isMultistate && this.inAlternateState)
  702.    {
  703.       this.gotoAndStop(4);
  704.    }
  705.    else
  706.    {
  707.       this.gotoAndStop(1);
  708.    }
  709. };
  710. FDraggablePaneClass.prototype.widgetTrackOver = function()
  711. {
  712.    if(this.isMultistate && this.inAlternateState)
  713.    {
  714.       this.gotoAndStop(5);
  715.    }
  716.    else
  717.    {
  718.       this.gotoAndStop(3);
  719.    }
  720. };
  721. FDraggablePaneClass.prototype.shaderAction = function()
  722. {
  723.    if(this.inAlternateState)
  724.    {
  725.       this.inAlternateState = false;
  726.       this.controller.restoreHelper();
  727.    }
  728.    else
  729.    {
  730.       this.inAlternateState = true;
  731.       this.controller.shadePane();
  732.    }
  733. };
  734. FDraggablePaneClass.prototype.closeAction = function()
  735. {
  736.    this.controller.closePane();
  737. };
  738. FDraggablePaneClass.prototype.restoreHelper = function()
  739. {
  740.    this.restorePane();
  741. };
  742.